package com.example.b_308.software.view.main.contacts;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;

import com.example.b_308.software.view.main.message.BaselvAdapter;

import java.util.List;

/**
 * Created by B-308 on 2017/11/24.
 */
public class ContactAdapter extends BaseAdapter {
    List list;
    /*搜索输入框*/
    public static final int TYPE_SEARCH = 1;
    /*客户通讯录*/
    public static final int TYPE_CUSTOMER_CONTACT = 2;
    /*添加新同事*/
    public static final int TYPE_ADD_NEWSATFF = 3;
    /*公司组织架构*/
    public static final int TYPE_COMPANY_STRUCTURE = 4;
    /*员工列表字母标签*/
    public static final int TYPE_LETTER_TAG = 5;
    /*员工*/
    public static final int TYPE_STAFF = 6;

    @Override
    public int getItemViewType(int position) {
        return super.getItemViewType(position);
    }

    @Override
    public int getCount() {
        return list.size()+4;
    }

    @Override
    public Object getItem(int position) {
        switch (position){
            case 0:
                return TYPE_SEARCH;
            case 1:
                return  TYPE_CUSTOMER_CONTACT;
            case 2:
                return  TYPE_ADD_NEWSATFF;
            case 3:
                return  TYPE_COMPANY_STRUCTURE;
        }
        if(position>3){
            if (list.get(position) instanceof String){
                return TYPE_LETTER_TAG;
            }else{
                return  TYPE_STAFF;
            }

        }
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return null;
    }
    class SearchVeiwHolder  extends  BaselvHolder{
        EditText et_search;

        public SearchVeiwHolder(View convertview) {
            super(convertview);

        }
    }
}

